import {BaseThree} from "../base/BaseThree";
import * as THREE from 'three'

export class AddGeometry extends BaseThree {
  constructor( view, pos) {
    super(view,pos)
  }
  setup(pos) {
    var geometry = new THREE.BoxGeometry(1000, 1000, 1000);
    //对材质进行简单的着色
    var material = new THREE.MeshBasicMaterial({color: 0xff0000});
    //将geometry制作纹理
    var cube = new THREE.Mesh(geometry, material);
    //将位置从给定空间参考转换为内部渲染坐标系。
    let renderPos = this.toRenderCoordinates(pos);
    cube.position.set(...renderPos);
    console.log("物体的位置", cube.position)
    this.scene.add(cube);
    this.initRender();
  }
}

